<!-- 商城基本设置 -->
<extend name="Public:layout" />

<block name="pluginCSS">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/plugins/bootstrap-fileinput/bootstrap-fileinput.css"/>
</block>
<block name="loadJS">
<script src="__PUBLIC__/Admin/plugins/bootstrap-fileinput/bootstrap-fileinput.js"></script>
<script src="__PUBLIC__/admin/scripts/layer/layer.js" type="text/javascript"></script>
</block>
<block name="setJS">
<script>
function callback(message,status)  {  
	if(status==1)  {  
		layer.msg(message, 
			{icon: 1,time: 2000}
		);   
	}  else{  
		layer.msg(message, 
			{icon: 2,time: 2000}
		);   
		
	}  
}  
</script>
</block>

<block name="pagetitle">商城名称，Logo等设置</block>

<block name="page">
<div class="row">
	<div class="col-md-12">
		<div class="portlet">
			<div class="portlet-title">
				<div class="caption">
					<i class="fa <{$authIco}>"></i><{$authName}>
				</div>
				<div class="actions">
					<a href="#portlet_tab0" data-toggle="tab" class="btn default green-stripe">
						<i class="fa fa-cog"></i>
						<span class="hidden-480">
							 基本设置
						</span>
					</a>
					<a href="#portlet_tab1" data-toggle="tab" class="btn default yellow-stripe">
						<i class="fa fa-cog"></i>
						<span class="hidden-480">
							 邮件设置
						</span>
					</a>									
				</div>
			</div>
			<div class="portlet-body form">
				<div class="portlet-tabs">
				<div class="tab-content">
					
					<foreach name="configs"  item="v" key="k">
					<div class="tab-pane <if condition="$k eq 0">active</if>" id="portlet_tab<{$k}>">
						<!-- BEGIN FORM-->
						<form action="<{:U('index')}>" class="form-horizontal" target="ajax" method="post" enctype="multipart/form-data">
						<iframe style="display:none" name='ajax' id="ajax" ></iframe>
							<input type="hidden" name="parentId" value="<{$k}>">
							<div class="form-body">
								<foreach name="v"  item="val" key="key">
								<div class="form-group">
									<label class="col-md-3 control-label"><{$val['fieldName']}>：</label>
									<php>
										if($val['fieldType']=='text'):
									</php>
									<div class="col-md-4">
										<input type="text" name="<{$val['fieldCode']}>" class="form-control" placeholder="Enter text" value="<{$val['fieldValue']}>">
										<span class="help-block"><{$val['fieldTips']}></span>
									</div>

									<php>
										elseif($val['fieldType']=='radio'):
     
									</php>

									<div class="col-md-4">
										<div class="radio-list">

                                        <php>
                							foreach($val['txt'] as $kt => $vt):
										</php>
			
        								<label class="radio-inline">
       										<input type='radio' id='<{$val["fieldCode"]}>_<{$kt}>' autocomplete="off" name='<{$val["fieldCode"]}>' value='<{$val["val"][$kt]}>'<php>if($val["fieldValue"]==$val["val"][$kt]){ echo "checked";}</php> /><{$vt}>&nbsp;&nbsp;
       									</label>

										<php>endforeach;</php>
        								</div>
        							</div>

        							<php>
        								elseif($val['fieldType']=='file'):
        							</php>

									<div class="col-md-9">
										<div class="fileinput fileinput-new" data-provides="fileinput">
											<div class="fileinput-new thumbnail" style="width: 200px; height: 150px;">
												<!-- <img src="http://www.placehold.it/200x150/EFEFEF/AAAAAA&amp;text=无图像" alt=""/> -->
												<img src="__UPLOAD__/<{$val['fieldValue']|str_replace=".","_m.",###}>"/>
											</div>
											<div class="fileinput-preview fileinput-exists thumbnail" style="max-width: 200px; max-height: 150px;">
											</div>
											<div>
												<span class="btn default btn-file">
													<span class="fileinput-new">
														 选择图片
													</span>
													<span class="fileinput-exists">
														 更改图片
													</span>
													<input type="file" name="<{$val['fieldCode']}>" >
												</span>
												<a href="#" class="btn default fileinput-exists" data-dismiss="fileinput">
													 删除图片
												</a>
											</div>
										</div>
									</div>

        							<php>
        								elseif($val['fieldType']=='textarea'):
									</php>

									<div class="col-md-4">
										<textarea class="form-control" name="<{$val['fieldCode']}>"><{$val['fieldValue']}></textarea>
										<span class="help-block">
											 <{$val['fieldTips']}>
										</span>
									</div>
									<php>
        								endif;
     								</php>


								</div>
								</foreach>
								<div class="form-group fluid">
								<div class="col-md-offset-3 col-md-9">
									<button type="submit" class="btn blue">保存</button>
									<button type="reset" class="btn default">取消</button>
								</div>
							</div>								
							</div>							
						</form>
						<!-- END FORM-->
					</div>
					</foreach>
					
				</div>
				</div>
			</div>
		</div>
	</div>
</div>	
</block>